import { S } from '../../s';
import { IPSDEGridEditItemVR } from './ipsdegrid-edit-item-vr';
import { IPSDEFValueRule } from '../../dataentity/defield/valuerule/ipsdefvalue-rule';
import { IPSSysValueRule } from '../../valuerule/ipssys-value-rule';
import { PSModelObjectImpl } from '../../psmodel-object-impl';

export class PSDEGridEditItemVRImpl
  extends PSModelObjectImpl
  implements IPSDEGridEditItemVR
{
  get checkMode(): 1 | 2 | 3 {
    return this.M.checkMode;
  }

  protected psdefvaluerule: IPSDEFValueRule;
  getPSDEFValueRule(): IPSDEFValueRule | null {
    return (
      this.psdefvaluerule ||
      (this.psdefvaluerule = this.fillObjectModel(
        S._1d1,
        this.M.getPSDEFValueRule,
        S._2f2,
      ) as IPSDEFValueRule)
    );
  }

  getPSDEGridEditItemName(): string {
    return this.M.getPSDEGridEditItemName;
  }

  protected pssysvaluerule: IPSSysValueRule;
  getPSSysValueRule(): IPSSysValueRule | null {
    return (
      this.pssysvaluerule ||
      (this.pssysvaluerule = this.fillObjectModel(
        S._1b,
        this.M.getPSSysValueRule,
        S._2f3,
      ) as IPSSysValueRule)
    );
  }

  get valueRuleType(): 'DEFVALUERULE' | 'SYSVALUERULE' {
    return this.M.valueRuleType;
  }
  get cls(): string {
    return 'PSDEGridEditItemVRImpl';
  }
  instanceof(cls: string): boolean {
    if (cls == S._c8) return true;
    return super.instanceof(cls);
  }
}
